package cn.tao.hrm.client;

import cn.tao.hrm.domain.LoginUser;
import cn.tao.hrm.dto.LoginUserDto;
import cn.tao.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AuthServiceClientFallBackFactory implements FallbackFactory<AuthServiceClient> {

    @Override
    public AuthServiceClient create(Throwable throwable) {
        return new AuthServiceClient() {
            @Override
            public AjaxResult add(LoginUserDto loginUserDto) {
                return AjaxResult.me().setSuccess(false).setMessage("系统错误！请联系管理员");
            }
        };
    }
}
